<template>
	<uni-list>
		<uni-list-item clickable showArrow @click="toquestion"
			title="常见问题" />
		<uni-list-item clickable showArrow @click="tomessage"
			title="消息通知" />
		<uni-list-item clickable title="清除缓存" @click="onClick"/>
		<uni-list-item clickable showArrow @click="toaboutus"
			title="关于我们" />
		<uni-list-item clickable showArrow @click="logout"
			title="退出登录" />
	</uni-list>
</template>

<script setup>
	const toquestion =() => {
		uni.navigateTo({
			url: "/pages/question/question"
		})
	}
	const tomessage =() => {
		uni.navigateTo({
			url: "/pages/message/message"
		})
	}
	const onClick =() => {
		uni.showToast({
			title: '清除成功'
		})
	}
	const toaboutus =() => {
		uni.navigateTo({
			url: "/pages/aboutus/aboutus"
		})
	}
const logout=()=> {
	if (confirm('您确认要退出登录吗？')){
	    //清除存在localStorage中的数据
	    localStorage.removeItem('token');
	    localStorage.removeItem('user');
	    uni.navigateTo({
	    	url: "/pages/login/login",
	    })
	  }
	}
</script>

<style>

</style>
